require 'test/unit'
require 'lib/smppclient/pdu/command_status'

class TestCommandStatus < MiniTest::Unit::TestCase

  include SmppClient::Pdu

  def test_values
    assert_equal(0x00000000, CommandStatus::ESME_ROK)
    assert_equal(0x00000001, CommandStatus::ESME_RINVMSGLEN)
    assert_equal(0x00000002, CommandStatus::ESME_RINVCMDLEN)
    assert_equal(0x00000003, CommandStatus::ESME_RINVCMDID)
    assert_equal(0x00000004, CommandStatus::ESME_RINVBNDSTS)
    assert_equal(0x00000005, CommandStatus::ESME_RALYBND)
    assert_equal(0x00000006, CommandStatus::ESME_RINVPRTFLG)
    assert_equal(0x00000007, CommandStatus::ESME_RINVREGDLVFLG)
    assert_equal(0x00000008, CommandStatus::ESME_RSYSERR)
    assert_equal(0x0000000A, CommandStatus::ESME_RINVSRCADR)
    assert_equal(0x0000000B, CommandStatus::ESME_RINVDSTADR)
    assert_equal(0x0000000C, CommandStatus::ESME_RINVMSGID)
    assert_equal(0x0000000D, CommandStatus::ESME_RBINDFAIL)
    assert_equal(0x0000000E, CommandStatus::ESME_RINVPASWD)
    assert_equal(0x0000000F, CommandStatus::ESME_RINVSYSID)
    assert_equal(0x00000011, CommandStatus::ESME_RCANCELFAIL)
    assert_equal(0x00000013, CommandStatus::ESME_RREPLACEFAIL)
    assert_equal(0x00000014, CommandStatus::ESME_RMSGQFUL)
    assert_equal(0x00000015, CommandStatus::ESME_RINVSERTYP)
    assert_equal(0x00000033, CommandStatus::ESME_RINVNUMDESTS)
    assert_equal(0x00000034, CommandStatus::ESME_RINVDLNAME)
    assert_equal(0x00000040, CommandStatus::ESME_RINVDESTFLAG)
    assert_equal(0x00000042, CommandStatus::ESME_RINVSUBREP)
    assert_equal(0x00000043, CommandStatus::ESME_RINVESMCLASS)
    assert_equal(0x00000044, CommandStatus::ESME_RCNTSUBDL)
    assert_equal(0x00000045, CommandStatus::ESME_RSUBMITFAIL)
    assert_equal(0x00000048, CommandStatus::ESME_RINVSRCTON)
    assert_equal(0x00000049, CommandStatus::ESME_RINVSRCNPI)
    assert_equal(0x00000050, CommandStatus::ESME_RINVDSTTON)
    assert_equal(0x00000051, CommandStatus::ESME_RINVDSTNPI)
    assert_equal(0x00000053, CommandStatus::ESME_RINVSYSTYP)
    assert_equal(0x00000054, CommandStatus::ESME_RINVREPFLAG)
    assert_equal(0x00000055, CommandStatus::ESME_RINVNUMMSGS)
    assert_equal(0x00000058, CommandStatus::ESME_RTHROTTLED)
    assert_equal(0x00000061, CommandStatus::ESME_RINVSCHED)
    assert_equal(0x00000062, CommandStatus::ESME_RINVEXPIRY)
    assert_equal(0x00000063, CommandStatus::ESME_RINVDFTMSGID)
    assert_equal(0x00000064, CommandStatus::ESME_RX_T_APPN)
    assert_equal(0x00000065, CommandStatus::ESME_RX_P_APPN)
    assert_equal(0x00000066, CommandStatus::ESME_RX_R_APPN)
    assert_equal(0x00000067, CommandStatus::ESME_RQUERYFAIL)
    assert_equal(0x000000C0, CommandStatus::ESME_RINVOPTPARSTREAM)
    assert_equal(0x000000C1, CommandStatus::ESME_ROPTPARNOTALLWD)
    assert_equal(0x000000C2, CommandStatus::ESME_RINVPARLEN)
    assert_equal(0x000000C3, CommandStatus::ESME_RMISSINGOPTPARAM)
    assert_equal(0x000000C4, CommandStatus::ESME_RINVOPTPARAMVAL)
    assert_equal(0x000000FE, CommandStatus::ESME_RDELIVERYFAILURE)
    assert_equal(0x000000FF, CommandStatus::ESME_RUNKNOWNERR)
  end

  def test_custom
    CommandStatus.const_set("TEST", 0x11111111)
    assert_equal(0x11111111, CommandStatus::TEST)
  end
  
end